<script setup>
  import { ref, computed  } from 'vue';

  let date = ref(Date.now());
  let a = ref(10);
  let b = ref(10);
  const now = computed(() => {
    console.log("计算属性....")
    return a.value
  });
  // console.log(now)

  let fun = function(){
    console.log("进入函数....a = " + a.value)
    if(a.value>13){
      alert(now.value)
    }
    a.value++
  }

  let fun2 = () => {
    alert(result.value)
  }

  const result = computed(() => {
    console.log("我是b = " + b.value);
    return b.value;
  });
</script>

<template>
  <div>
    <input v-bind:type="'button'" v-bind:value="'点击'" v-on:click="fun()" /><br>
    <input v-bind:type="'button'" v-bind:value="'点击测试计算属性依赖的值不变不重新走逻辑'" v-on:click="fun2()" />
  </div>
</template>

<style scoped>

</style>
